#!/usr/bin/env python
# Shenzhen Joyton RD - Awesome 2022-12-08

import rospy
from std_msgs.msg import Float32
import  msp

rospy.loginfo("------ MSP Vol Test Node ------")

def battery_voltage_callback(v):
    rospy.loginfo("Battery Voltage: %.1fV" % v.data)

def msp_vol_node_test_run():
    rospy.init_node('msp_node_test', anonymous=True)
    batt_vol_pub = rospy.Subscriber('battery_voltage',  Float32, callback=battery_voltage_callback, queue_size=1)
    rospy.spin()

if __name__=="__main__":
   try:
       msp_vol_node_test_run()
   except:
      rospy.loginfo("Run Error!")
      pass